package com.eshop.enums;

import java.util.stream.Stream;

public enum PayMethodEnum
{
    WECHAT("wechat", "公众号支付"), 
    WXAPP("wxapp", "小程序支付"), 
    APP("app", "app支付");
    
    private String value;
    private String desc;
    
    public static PayMethodEnum toType(final String value) {
        return Stream.of(values()).filter(p -> p.value.equals(value)).findAny().orElse(null);
    }
    
    public String getValue() {
        return this.value;
    }
    
    public String getDesc() {
        return this.desc;
    }
    
    private PayMethodEnum(final String value, final String desc) {
        this.value = value;
        this.desc = desc;
    }
}
